package ihm;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;

public class FenetreAjouterContrat {

	private JFrame frmAjouterUnContrat;
	private JTextField txtNomClient;
	private JTextField txtObjet;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					FenetreAjouterContrat window = new FenetreAjouterContrat();
					window.frmAjouterUnContrat.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public FenetreAjouterContrat() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmAjouterUnContrat = new JFrame();
		frmAjouterUnContrat.setTitle("Ajouter un contrat");
		frmAjouterUnContrat.setBounds(100, 100, 311, 207);
		frmAjouterUnContrat.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JLabel lblObjet = new JLabel("Objet :");
		
		JLabel lblNomClient = new JLabel("Nom du client :");
		
		txtNomClient = new JTextField();
		txtNomClient.setColumns(10);
		
		txtObjet = new JTextField();
		txtObjet.setColumns(10);
		
		JButton btnNewButton = new JButton("Valider");
		
		JButton btnAnnuler = new JButton("Annuler");
		GroupLayout groupLayout = new GroupLayout(frmAjouterUnContrat.getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(Alignment.LEADING, groupLayout.createSequentialGroup()
					.addGap(51)
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(15)
							.addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 78, Short.MAX_VALUE)
							.addGap(18)
							.addComponent(btnAnnuler, GroupLayout.PREFERRED_SIZE, 81, Short.MAX_VALUE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(lblObjet)
								.addComponent(lblNomClient))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(txtNomClient, 111, 111, 111)
								.addComponent(txtObjet, 111, 111, 111))))
					.addGap(52))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(22)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblObjet)
						.addComponent(txtObjet, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(31)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNomClient)
						.addComponent(txtNomClient, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(30)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnNewButton)
						.addComponent(btnAnnuler))
					.addContainerGap(23, Short.MAX_VALUE))
		);
		frmAjouterUnContrat.getContentPane().setLayout(groupLayout);
	}
}
